<jsp:include page="logincheck.jsp" />
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page import="java.util.*" %>

<jsp:useBean id="adminAcct" class="se2.Administrator" scope="request"/>
<jsp:setProperty name="adminAcct" property="*"/>

<html>

	<head>
		<title>Administration Console</title>
		<link rel="stylesheet" href="default.css" type="text/css" media="screen"></link>
		<script src="sorttable.js"></script>
	</head>

	<body>
		<div id="container">
			<div id="navigation">
<p>&nbsp;</p>
<jsp:include page="navigation.jsp" />
			</div>
			
			<div id="header">				
				<img src="images/header.png" />
			</div>

			<div id="content">
<!-- Main code -->


				<h1>Administrator Accounts :: View All</h1>
	
				<table class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr style="background-image: url('images/tableBackground.png');" height="50">
						<th style="background-image: url('images/tableBackground.png');" width="100" align="center" class="sorttable_nosort tableHeader"><a href="addAdministratorAccount.jsp"><img src="images/add.png"></a></th>
						<th style="background-image: url('images/tableBackground.png');" width="*" align="center" class="tableHeader">Administrator ID</th>
						<th style="background-image: url('images/tableBackground.png');" width="*" align="center" class="tableHeader">Name</th>
						<th style="background-image: url('images/tableBackground.png');" width="*" align="center" class="tableHeader">E-mail Address</th>
						<th style="background-image: url('images/tableBackground.png');" width="*" align="center" class="tableHeader">Username</th>
						<th style="background-image: url('images/tableBackground.png');" width="*" align="center" class="tableHeader">Password</th>
						<th style="background-image: url('images/tableBackground.png');" width="100" align="center" class="sorttable_nosort tableHeader"">&nbsp;</th>
					</tr>

					<% boolean odd = false; %>
					<c:forEach var="admin" items="${adminAcct.allAdminAccts}">
						<% if (odd) { %>
							<tr style="background-image: url('images/tableBackground.png');">
						<% } else { %>
							<tr>
						<% } odd = !odd; %>
							<td><center><a href="editAdministratorAccount.jsp?id=${admin.id}"><img src="images/edit.png" alt="Edit" title="Edit" /></a></center></td>
							<td><center>${admin.id}</center></td>
							<td><center>${admin.name}</center></td>
							<td><center>${admin.email}</center></td>
							<td><center>${admin.username}</center></td>
							<td><center>${admin.password}</center></td>
							<td><c:if test="${admin.id!=0}"><center><a href="removeAdministratorAccount.jsp?id=${admin.id}"><img src="images/remove.png" alt="Remove" title="Remove" /></a></center></c:if></td>
						</tr>
					</c:forEach>
				</table>


<!-- Main Code -->
			</div>

			<div id="footer">
<jsp:include page="footer.jsp" />
			</div>
		</div>
	</body>

</html>